package controller;

import model.Schedule;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import service.ScheduleService;

import javax.annotation.Resource;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@ResponseBody
@RequestMapping("/schedule")
public class ScheduleController {
    @Resource
    private ScheduleService service;
    @RequestMapping("/findSchedule.do")
    public Map<String,Object> findSchedule(String departmentId, Integer sign){
//        System.out.println(departmentId);
//        System.out.println(sign);
        List<Schedule> list = service.findScheduleByDepartmentIdAndInquiryTime(departmentId, sign);
        System.out.println(list);
        Map<String,Object> map = new HashMap<>();
        map.put("code","200");
        map.put("msg","");
        map.put("data",list);
        return map;
    }
}
